﻿using MGLibrarySystem.BLL;
using MGLibrarySystem.Common;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using static MGLibrarySystem.Model.LibraryModels;

namespace MGLibrarySystem.UI
{
    public partial class Admin : Form
    {
        public Admin()
        {
            InitializeComponent();
            this.skinEngine1.SkinFile = this.skinEngine1.SkinFile = "Skins\\WaveColor1.ssk";
        }
        Admin_BLL aa = new Admin_BLL();

        private void textBox1_TextChanged(object sender, EventArgs e)
        {

        }
       
        private void btn_Suer_Click(object sender, EventArgs e)
        {
            AdminManages a = new AdminManages();
            a.LoginName = txt_UserName.Text.Trim();
            a.LoginPwd = txt_Pwd.Text.Trim();
            
            if (aa.Scalar(a))
            {
                FrmMain f = new FrmMain();
                f.adminManages = a;

                f.Show();
                this.Hide();
                this.Visible = false;
            }
            else
            {
                MessageBox.Show("登录失败，请重新输入账号或密码！！", "温馨提示！", MessageBoxButtons.OKCancel, MessageBoxIcon.Error);
            }
        }

        private void Admin_Load(object sender, EventArgs e)
        {

        }
    }
}
